<template>
	<!-- 1 -->
	<view class="y-page-common page">
		<view class="card form">
			<cell title='申请人姓名' mode="input" v-model="formData.name" required></cell>
			<cell title='身份证号' mode="input" v-model="formData.IDCardNo"></cell>
			<cell title='业务办理城市' mode="region" v-model="formData.ywblcs"></cell>
			<cell title='期望业务办理网点' mode="selector" :selectorItem='selectorItem' v-model="formData.ywblwd"></cell>
			<cell title='推荐人代码' mode="input" v-model="formData.tjrdm"></cell>
		</view>
		<ReadmeBtn fixed="true" :readme="['交通银行小微授信业务个人信息处理授权书']" text="发起申请" @submit="submit"></ReadmeBtn>
	</view>

	</view>
</template>

<script>
	import cell from "@/components/cell.vue"
	export default {
		components: {
			cell
		},
		data() {
			return {
				formData: {
					name: '张三',
					IDCardNo: '511018****',
					ywblcs: '1',
					ywblwd: '1',
					tjrdm: '业务员1'
				},
				selectorItem: [{
						value: '1',
						label: '网点1'
					},
					{
						value: '2',
						label: '网点2'
					},
					{
						value: '3',
						label: '网点3'
					},
					{
						value: '4',
						label: '网点4'
					},
					{
						value: '5',
						label: '网点5'
					}
				],

			}
		},
		onLoad() {

		},
		watch: {
			index() {
				// this.array[1] = this.areas[this.index]
			},
			formData: {
				handler(value) {
					uni.setStorageSync('userInfo', value);
				},
				deep: true
			}
		},
		methods: {
			async submit() {
				if (!this.formData.name) {
					uni.showToast({
						icon: "none",
						title: '必填信息请填写完整',
						duration: 3000,
						position: 'top'
					})
					return
				}
				await this.$myloading() // async
				uni.navigateTo({
					url: '/pages/personal/limit'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page {
		width: 100%;
		height: 100%;
		position: absolute;

		.form {
			margin-bottom: 200rpx;
		}
	}
</style>